package com.flea.hclv.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.flea.hclv.model.entity.HVisitor;
import com.flea.hclv.model.entity.HVisitorOrder;
import com.flea.hclv.model.entity.vo.ProductTimeTableVo;
import com.flea.hclv.util.ServerResponse;
import com.flea.system.bean.FleaPage;
import com.flea.system.entity.OrgDept;
import org.springframework.transaction.annotation.Transactional;

public interface HVisitorOrderService {

    ServerResponse<ProductTimeTableVo> placeAnOrder(String timeTableId);

    ServerResponse<Map<String,String>> createOrder(String userId, OrgDept currentUserDept, ProductTimeTableVo productVo, List<String> visitorIds, String paymentPersonId);

    ServerResponse<String> pay(HVisitorOrder order, String userId);

    ServerResponse<String> cancel(String orderNo, String userId) throws Exception;

    ServerResponse<List<HVisitorOrder>> selectOrderList(String userId);
    /**
     * 创建订单
     * @description
     * @methodName addOrder
     * @param
     * @returnType ServerResponse<HVisitorOrder>   
     * @throw
     */
	ServerResponse<HVisitorOrder> addOrder(HttpServletRequest request,String model) throws Exception;
	  /**
     * 修改订单
     * @description
     * @methodName addOrder
     * @param
     * @returnType ServerResponse<HVisitorOrder>   
     * @throw
     */
	ServerResponse<HVisitorOrder> updateOrder(HttpServletRequest request,String model)
      throws Exception;

	ServerResponse<FleaPage<HVisitorOrder>> findVisitorOderByOrgId(HttpServletRequest request, String model,int indexPage,int pageSize);
	/**
	 * 根据订单id，显示所有的游客信息
	 * @description
	 * @methodName findVisitorsByOrderId
	 * @param
	 * @returnType ServerResponse<List<HVisitor>>   
	 * @throw
	 */
	ServerResponse<List<HVisitor>> findVisitorsByOrderId(
			HttpServletRequest request, String orderId);
	/**
	 * 
	 * @description 关闭订单
	 * @methodName updateVisitorStatusToClose
	 * @param
	 * @throws Exception 
	 * @returnType ServerResponse<List<HVisitor>>   
	 * @throw
	 */
	ServerResponse<List<HVisitorOrder>> updateVisitorStatusToClose(HttpServletRequest request, String model) throws Exception;
	/**
	 * 
	 * @description 设置订单完成
	 * @methodName updateVisitorStatusToOk
	 * @param
	 * @returnType ServerResponse<List<HVisitor>>   
	 * @throw
	 */
	ServerResponse<List<HVisitorOrder>> updateVisitorStatusToOk(HttpServletRequest request, String model) throws Exception;

  /**
   * 取消订单
   * @param request
   * @param orderNo
   * @return
   */
  ServerResponse<String> updateVisitorStatusToCancel(HttpServletRequest request, String orderNo)
      throws Exception;

  /**
   * 根据订单id获取订单详情
   * @param orderId
   * @return
   * @throws Exception
   */
  ServerResponse findOrderDetailById(String orderId) throws Exception;

  /**
   * 根据团id，获取订单列表
   * @param model
   * @param request
   * @return
   */
  ServerResponse findByGroupId(String model, HttpServletRequest request,int index,int pageSize)throws  Exception;
  /**
   * 根据团id，获取订单列表
   * @param groupId
   * @return
   */
  List<HVisitorOrder> findByGroupIdToList(String groupId);

  /**
   * 根据所有
   * @param timeTableId
   * @return
   */
  List<HVisitorOrder> findByProductTimeTableIdToList(String timeTableId);

  ServerResponse updateVisitorByOrderId(String model, HttpServletRequest request) throws Exception;

  ServerResponse delVisitorByOrderNoAndVisitorId(String model, HttpServletRequest request)throws Exception;

  ServerResponse<FleaPage<HVisitorOrder>> getAllNoCompleteVisitorListByUserId(HttpServletRequest request, String model, int curPage, int pageSize);

  ServerResponse<FleaPage<HVisitorOrder>> getAlllistCompleteVisiterOrder(HttpServletRequest request, String model, int curPage, int pageSize);
}
